package com.zpark.provider.service.impl;

import com.zpark.provider.entity.Books;
import com.zpark.provider.mapper.IBooksMapper;
import com.zpark.provider.service.IBooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @PackageName: com.zpark.provider.service.impl
 * @ClassName: BooksServiceImpl
 * @Description:
 * @author: RZS
 * @date: 2023/6/13  14:36
 */
@Service
public class BooksServiceImpl implements IBooksService {

    @Autowired
    private IBooksMapper booksMapper;

    @Override
    public Books findById(Integer id) {
        return booksMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Books> findAll() {
        return booksMapper.selectAll();
    }

    @Override
    public Integer removeBooks(Integer id) {
        return booksMapper.deleteByPrimaryKey(id);
    }
}
